package com.wzh.controll;

import com.wzh.pojo.Po.NameList;
import com.wzh.pojo.Req.DataReq;
import com.wzh.pojo.Resp.DataResp;
import com.wzh.service.NameListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/Name")
public class NameListController {


	@Autowired
	private NameListService nameListService;
	@PostMapping("/show")
	@ResponseBody
	public DataResp show(@RequestBody DataReq req){
		DataResp<Object> resp= nameListService.show(req);
		return resp;
	};

	@PostMapping("/delName")
	@ResponseBody
	public DataResp del(@RequestBody NameList name){
		DataResp<Object> resp= nameListService.del(name);
		return resp;
	};

	@PostMapping("/add")
	@ResponseBody
	public DataResp add(@RequestBody NameList name){
		DataResp<Object> resp= nameListService.add(name);
		return resp;
	};
	@PostMapping("/update")
	@ResponseBody
	public DataResp update(@RequestBody NameList name){
		DataResp<Object> resp= nameListService.update(name);
		return resp;
	};
}
